//instanceof
// console.log([] instanceof Array);//true
// console.log({} instanceof Object);//true
// console.log(function(){} instanceof Function);//true
// console.log(Symbol() instanceof Symbol);//true
// console.log(BigInt(123) instanceof BigInt);//true
// console.log(new Date() instanceof Date);//true

function myInstanceof(L, R) {
    if (typeof R !== 'function') {
        throw new TypeError('Right-hand side of instanceof is not an object');
    }
    if (typeof L !== 'object' || L === null) {
        return false;
    }
    L = L.__proto__
    while (L) {
        if (L === R.prototype) {
            return true
        }
        L = L.__proto__
    }
    return false
}
console.log(myInstanceof(null,Object));
let a = 1 
// let a = new Number(1)
a.number = 123
console.log(a.toString());

